<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/
/**商城首页*/
Route::get('/','IndexController@index');

/**用户登陆注册,不需要登陆的访问路由*/
Route::get('/code','LoginController@code');

/**短信服务校验*/
Route::post('/checkcode','MscodeController@checkcode');
Route::post('/mscode','MscodeController@mscode');

/**用户信息校验*/
Route::get('/login','LoginController@login');
Route::post('/dologin','LoginController@dologin');
Route::get('/register','LoginController@register');
Route::post('/doregister','LoginController@doregister');
Route::get('/forgetpw','LoginController@forgetpw');
Route::post('/resetpw','LoginController@resetpw');
Route::post('/storepw','LoginController@storepw');

/**需要登陆才能访问的路由*/
Route::group(['middleware'=>'login'],function() {
    Route::get('/loginout','LoginController@loginout');

    /**用户中心操作*/
    Route::group(['prefix'=>'user'],function(){
        /**账户[账单]*/
        Route::get('/account','UserController@account');
        Route::post('/account/consume','UserController@account_consume');
        Route::post('/account/bill','UserController@account_bill');

        /**我的订单*/
        Route::get('/order','UserController@order');
        Route::get('/order_delete/{id}','UserController@order_delete');//订单单个删除
        Route::get('/order_deletes/{id}','UserController@order_deletes');//订单整体删除
        Route::get('/orderdt/{id}','UserController@orderdt');

        /**在租家具*/
        Route::get('/rentfitment','UserController@rentfitment');
        Route::get('/rentfitment/rent_status/{id}','UserController@rent_status');
        Route::get('/rentback/{id}','UserController@rentback');//退租,转租
        Route::post('/dorentback','UserController@dorentback');
        Route::get('/rentrepair/{id}','UserController@rentrepair');//售后
        Route::post('/rentrepair_post','UserController@rentrepair_post');
        /**账单*/
        Route::get('/bill','UserController@bill');
        Route::get('/bill_months','UserController@bill_months');

        /**优惠券*/
        Route::get('/coupon','UserController@coupon');

        /**账户充值*/
        Route::get('/recharge','UserController@recharge');
        Route::post('/recharge','UserController@rechargee');
        /**押金额度*/
        Route::get('/quota_apply','UserController@quota_apply');
        Route::post('/quota_post','UserController@quota_post');
        Route::get('/quota','UserController@quota');
        Route::get('/quota_add','UserController@quota_add');
        Route::post('/quota_add_post','UserController@quota_add_post');
        Route::get('/getzhima','UserController@getzhima');
        Route::get('quota_editisdel/{id}','UserController@quota_editisdel');

        /**个人信息*/
        Route::get('','UserController@user');
        Route::post('/update/{id}','UserController@update');
        Route::post('/avatar/{id}','UserController@avatar');

        /**发票信息*/
        Route::get('/invoice','UserController@invoice');
        Route::post('/invoiceapply','UserController@invoiceapply');
        Route::get('/invoice_ensure/{id}','UserController@invoice_ensure');

        /**收货地址*/
        Route::get('/address','UserController@address');
        Route::post('/addaddr/{id}','UserController@addaddr');
        Route::get('/addr/default/{id}','UserController@defaultad');
        Route::get('/addrdestroy/{id}','UserController@addrdestroy');
    });

    Route::group(['prefix'=>'quota'],function(){
        Route::post('/ident','QuotaController@ident');
    });

    /**购物车*/
    Route::get('/shopcart','ShopCartController@index');
    Route::get('/shopcart/fitment_dts/{pid}','ShopCartController@fitment_dts');
    Route::get('/shopcart/edit_status','ShopCartController@edit_status');
    Route::post('/shopcart/add','ShopCartController@add');
    Route::post('/shopcart/edit/{id}','ShopCartController@edit');
    Route::post('/shopcart/delete/{id}','ShopCartController@destroy');
    Route::get('/confirmorder','ShopCartController@confirmorder');
    Route::get('/add_combine','ShopCartController@add_combine');
    Route::get('/immediatorder/{id}','ShopCartController@immediatorder');//立即租赁操作

    /**下单*/
    //下单页面
    Route::get('/paybill','PayController@paybill');
    //支付方式
    Route::post('pay_type','PayController@payType');
//    支付宝支付页面
    Route::post('/alipay','PayController@repay');
    //支付宝扫码支付
    Route::post('/pagepay','PayController@pagepay');
    //支付宝支付成功
    Route::get('/dobill','PayController@dobill');
    Route::post('/cartorder','OrderController@cartorder');
    //微信支付成功返回
    Route::post('/wxnotify','PayController@wxnotify');
    /**家具详情*/
    Route::get('/fitment/show/{id}','FitmentController@show');

    /**增值服务*/
    Route::get('/customized','ExtraController@customized');
    Route::post('/customized_data','ExtraController@customized_data');
    Route::get('/interior_design','ExtraController@interior_design');
    Route::post('/interior_design_data','ExtraController@interior_design_data');
    Route::get('/move_server','ExtraController@move_server');
    Route::post('/move_server_data','ExtraController@move_server_data');

    /**公用图片上传*/
    Route::any('/upload','CommonController@upload');
});

/**接受回调*/
Route::get('/quota_reback','UserController@quota_reback');

/**家具*/
Route::get('/fitment','FitmentController@index');
Route::post('/append','FitmentController@append');

Route::get('/news','NewsController@index');

/**底部信息*/
Route::get('/company_introduce','IndexController@company_introduce');
Route::get('/join_us','IndexController@join_us');
Route::get('/after_service','IndexController@after_service');
Route::get('/guide','IndexController@guide');
Route::get('/pay_style','IndexController@pay_style');
Route::get('/deliver_policy','IndexController@deliver_policy');